package com.ruoyi.common.constant;

/**
 * Wechat层级常量值
 */
public class WxAliConstants {

    /**
     * 微信配置信息redis存储key
     */
    public static final String REDIS_WECHAT_ACCESS_TOKEN = "configCache:wechat_access_token";//微信接口调用凭证token
    public static final String REDIS_WECHAT_CONFIG = "configCache:wechat_config";
    public static final String REDIS_TXOSS_CONFIG = "configCache:tx_oss";
    public static final String REDIS_ALIPAY_CONFIG = "configCache:alipay_config";
    public static final String REDIS_ALIVOD_KEY = "configCache:ali_vod";//阿里vod视频点播key
    public static final String REDIS_ALIPHONEPROTECT_KEY = "configCache:ali_phone_protect";//阿里手机隐私保护

    /**
     * 微信支付场景，公众号，小程序还是开发平台应用
     */
    public static final String PAY_MINIWX = "mini_wx";
    public static final String PAY_WEBWX = "web_wx";
    public static final String PAY_PUBWX = "public_wx";
    public static final String PAY_PAYTOUSER = "pay_user";
    public static final String PAY_PAYTOBANK = "pay_bank";
    public static final String GET_PUBLIC_KEY = "pay_public_key";

    /**
     * 支付宝支付参数规定的产品码
     * 1.电脑网站支付产品alipay.trade.page.pay接口中，product_code为：FAST_INSTANT_TRADE_PAY
     * 2.手机网站支付产品alipay.trade.wap.pay接口中，product_code为：QUICK_WAP_WAY
     * 3.当面付条码支付产品alipay.trade.pay接口中，product_code为：FACE_TO_FACE_PAYMENT
     * 4.APP支付产品alipay.trade.app.pay接口中，product_code为：QUICK_MSECURITY_PAY
     */
    public static final String PRODUCT_CODE_TRADE = "FAST_INSTANT_TRADE_PAY";
    public static final String PRODUCT_CODE_WAP = "QUICK_WAP_WAY";
    public static final String PRODUCT_CODE_FACE = "FACE_TO_FACE_PAYMENT";
    public static final String PRODUCT_CODE_MSECURITY = "QUICK_MSECURITY_PAY";

    /**
     * 微信支付参数规定交易类型trade_type
     * JSAPI--JSAPI支付（或小程序支付）、NATIVE--Native支付、APP--app支付，MWEB--H5支付，
     */
    public static final String TYPE_JSAPI = "JSAPI";
    public static final String TYPE_NATIVE = "NATIVE";
    public static final String TYPE_APP = "APP";
    public static final String TYPE_H5 = "H5";


    /**
     * 微信相关接口路径
     */
    public static final String WEB_AUTH_CODE_URL_base = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=%s&redirect_uri=%s&response_type=code&scope=snsapi_base&state=%s#wechat_redirect";//获取网页授权code路径,静默授权
    public static final String WEB_AUTH_CODE_URL_userinfo = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=%s&redirect_uri=%s&response_type=code&scope=snsapi_userinfo&state=%s#wechat_redirect";//获取网页授权code路径，非静默授权
    public static final String MINI_AUTH_CODE_CHECK_URL = "https://api.weixin.qq.com/sns/jscode2session?appid=%s&secret=%s&js_code=%s&grant_type=authorization_code";//小程序微信登陆后，通过code进行登录凭证校验
    public static final String CODE_LOCAL_NOTIFY_URL = "http%3A%2F%2Fyangz.vaiwan.com%2FwxAli%2FwxApi%2FWxAuthToken%2FcodeNotify";//获取code后的回调接口路径
    public static final String CODE_GET_ACCESS_TOKEN_URL = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=%s&secret=%s&code=%s&grant_type=authorization_code";//通过code换取网页授权access_token
    public static final String ACCESS_OPENID_GET_USERINFO_URL = "https://api.weixin.qq.com/sns/userinfo?access_token=%s&openid=%s&lang=zh_CN";//通过网页授权accessTokn和openid获取用户微信信息
    public static final String APPID_SECURT_ACCESS_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/stable_token?grant_type=client_credential";//全局唯一后台接口调用凭据
    public static final String PUBLIC_TEMPLATE_SEND_URL = "https://api.weixin.qq.com/cgi-bin/message/subscribe/bizsend?access_token=%s";//微信公众平台--“公众号”订阅消息模板发送接口
    public static final String MINI_TEMPLATE_SEND_URL = "https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=%s";//微信公众平台--“小程序”订阅消息模板发送接口
    public static final String MINI_QRCODE_CREATE_URL = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=%s";//微信公众平台--“小程序”二维码生成接口
    public static final String MINI_PHONE_ACCESS_TOKEN_URL="https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=%s";//换取用户手机号

}
